<!-- 字段配置 -->
<template>
  <a-card
    style="width: 100%"
    :tab-list="tabList"
    :active-tab-key="titleKey"
    @tabChange="(key) => onTabChange(key)"
    :bordered="false"
    class="br-10"
  >
    <template v-if="titleKey === 'organization'">
      <Organization />
    </template>
    <template v-else-if="titleKey === 'industry'">
      <Industry />
    </template>
    <!-- <template v-else-if="titleKey === 'level'">
      <GradeEvaluation />
    </template>
    <template v-else-if="titleKey === 'town'">
      <MemberTowns />
    </template> -->
  </a-card>
</template>

<script>
import Organization from './organization'
import Industry from './industry'
import GradeEvaluation from './gradeEvaluation'
import MemberTowns from './memberTowns'
import { checkPermission } from '@/utils/authority'

export default {
  components: {
    Organization,
    Industry,
    GradeEvaluation,
    MemberTowns,
  },
  data() {
    return {
      tabList: [],
      titleKey: 'organization',
    }
  },
  computed: {},
  watch: {},
  methods: {
    onTabChange(key) {
      this.titleKey = key
    },
  },
  created() {
    if(checkPermission('member:memberConfig:fieldsConfig:organization')){
      this.tabList.push({
          key: 'organization',
          tab: '单位类别',
      })
    }
    if(checkPermission('member:memberConfig:fieldsConfig:industry')){
      this.tabList.push({
          key: 'industry',
          tab: '行业管理',
      })
    }
    // if(checkPermission('member:memberConfig:fieldsConfig:level')){
    //   this.tabList.push({
    //       key: 'level',
    //       tab: '等级评估',
    //   })
    // }
    // if(checkPermission('member:memberConfig:fieldsConfig:town')){
    //   this.tabList.push({
    //       key: 'town',
    //       tab: '镇属',
    //   })
    // }
  },
  mounted() {},
}
</script>
<style scoped></style>
